{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "helper load finish!!!\n"
     ]
    }
   ],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "from base_helper import *\n",
    "test_op_rd = get_operation_round1_new()\n",
    "train_op_tr = get_operation_train_new()\n",
    "\n",
    "tag = get_tag_train_new()\n",
    "test_op_rd[tag_hd.Tag] = -1\n",
    "train_op_tr = pd.merge(train_op_tr, tag, on='UID', how='left')\n",
    "\n",
    "'''合并训练测试集'''\n",
    "train_op_trs = pd.concat([train_op_tr, test_op_rd], axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 操作表中异常数据的清除， 主要操作系统的处理,以及ip2地址的删除"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_op_trs = train_op_trs[train_op_trs.os.isin([101,102,103,200])].reset_index()\n",
    "train_op_trs['device_code3'] = np.where(train_op_trs['os'] == 101, '98d2654c0f52dca0', train_op_trs['device_code3'])\n",
    "train_op_trs.drop(['ip2', 'ip2_sub'], axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# day相关的feature"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(61213, 1)\n",
      "(61213, 2)\n"
     ]
    }
   ],
   "source": [
    "train_op_feature = pd.DataFrame({'UID':[i for i in train_op_trs.UID.unique()]})\n",
    "print(train_op_feature.shape)\n",
    "train_op_feature = train_op_feature.merge(train_op_trs.drop_duplicates(['UID','Tag'])[['UID','Tag']],\n",
    "                                          on='UID', how='left')\n",
    "print(train_op_feature.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''总共的操作次数'''\n",
    "train_op_feature = pd.merge(train_op_feature, \n",
    "                            train_op_trs.groupby('UID', as_index=False)['day'].agg({'op_count':'count'}), on='UID', how='left')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''一共参与的天数'''\n",
    "train_day = train_op_trs.copy()\n",
    "train_day.drop_duplicates(['UID', 'day'], inplace=True)\n",
    "train_day = train_day.groupby('UID', as_index=False)['day'].agg({'day_count_op':'count'})\n",
    "train_op_feature = pd.merge(train_op_feature, train_day, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UID</th>\n",
       "      <th>Tag</th>\n",
       "      <th>op_count</th>\n",
       "      <th>day_count_op</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10035</td>\n",
       "      <td>0</td>\n",
       "      <td>112</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>16264</td>\n",
       "      <td>0</td>\n",
       "      <td>241</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13162</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>21392</td>\n",
       "      <td>0</td>\n",
       "      <td>49</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>18599</td>\n",
       "      <td>1</td>\n",
       "      <td>179</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     UID  Tag  op_count  day_count_op\n",
       "0  10035    0       112            23\n",
       "1  16264    0       241            21\n",
       "2  13162    0        17             3\n",
       "3  21392    0        49             9\n",
       "4  18599    1       179            13"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_feature.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>UID</th>\n",
       "      <th>day</th>\n",
       "      <th>mode</th>\n",
       "      <th>success</th>\n",
       "      <th>time</th>\n",
       "      <th>os</th>\n",
       "      <th>version</th>\n",
       "      <th>device1</th>\n",
       "      <th>device2</th>\n",
       "      <th>device_code1</th>\n",
       "      <th>device_code2</th>\n",
       "      <th>device_code3</th>\n",
       "      <th>mac1</th>\n",
       "      <th>mac2</th>\n",
       "      <th>ip1</th>\n",
       "      <th>wifi</th>\n",
       "      <th>geo_code</th>\n",
       "      <th>ip1_sub</th>\n",
       "      <th>Tag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>10035</td>\n",
       "      <td>30</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17:51:50</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>55dd8936655c86f6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wskx</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5077</th>\n",
       "      <td>5085</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>09:01:41</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13497</th>\n",
       "      <td>13524</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>09:01:39</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22298</th>\n",
       "      <td>22344</td>\n",
       "      <td>10035</td>\n",
       "      <td>1</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>20:43:44</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22598</th>\n",
       "      <td>22644</td>\n",
       "      <td>10035</td>\n",
       "      <td>26</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:12:01</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>9c9d49eddb6a59c3</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23092</th>\n",
       "      <td>23138</td>\n",
       "      <td>10035</td>\n",
       "      <td>3</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19:19:54</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39896</th>\n",
       "      <td>39969</td>\n",
       "      <td>10035</td>\n",
       "      <td>30</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:15:45</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>830e4b02f0bc0e18</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ws7e</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48575</th>\n",
       "      <td>48660</td>\n",
       "      <td>10035</td>\n",
       "      <td>10</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:06:28</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50839</th>\n",
       "      <td>50925</td>\n",
       "      <td>10035</td>\n",
       "      <td>23</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>21:31:38</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53422</th>\n",
       "      <td>53511</td>\n",
       "      <td>10035</td>\n",
       "      <td>10</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:06:28</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55066</th>\n",
       "      <td>55158</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>09:01:39</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63815</th>\n",
       "      <td>63922</td>\n",
       "      <td>10035</td>\n",
       "      <td>15</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:56:25</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70326</th>\n",
       "      <td>70442</td>\n",
       "      <td>10035</td>\n",
       "      <td>6</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:47:49</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74223</th>\n",
       "      <td>74347</td>\n",
       "      <td>10035</td>\n",
       "      <td>22</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17:40:38</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74486</th>\n",
       "      <td>74611</td>\n",
       "      <td>10035</td>\n",
       "      <td>14</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>18:58:07</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78036</th>\n",
       "      <td>78168</td>\n",
       "      <td>10035</td>\n",
       "      <td>18</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>07:48:32</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82847</th>\n",
       "      <td>82985</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>07:34:17</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>4cd4a3df70a9960b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85111</th>\n",
       "      <td>85253</td>\n",
       "      <td>10035</td>\n",
       "      <td>30</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17:51:50</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>55dd8936655c86f6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>wskx</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87896</th>\n",
       "      <td>88042</td>\n",
       "      <td>10035</td>\n",
       "      <td>8</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>08:40:18</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>ef45c765457dc4d8</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>f6a53982aad75bd1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98988</th>\n",
       "      <td>99152</td>\n",
       "      <td>10035</td>\n",
       "      <td>10</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:06:28</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100136</th>\n",
       "      <td>100303</td>\n",
       "      <td>10035</td>\n",
       "      <td>17</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:41:14</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>102732</th>\n",
       "      <td>102908</td>\n",
       "      <td>10035</td>\n",
       "      <td>3</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19:19:53</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105984</th>\n",
       "      <td>106165</td>\n",
       "      <td>10035</td>\n",
       "      <td>14</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>18:58:07</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112655</th>\n",
       "      <td>112847</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>07:34:16</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>4cd4a3df70a9960b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120066</th>\n",
       "      <td>120268</td>\n",
       "      <td>10035</td>\n",
       "      <td>27</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>09:01:41</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123381</th>\n",
       "      <td>123590</td>\n",
       "      <td>10035</td>\n",
       "      <td>20</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:02:23</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123461</th>\n",
       "      <td>123670</td>\n",
       "      <td>10035</td>\n",
       "      <td>12</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:04:44</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125436</th>\n",
       "      <td>125647</td>\n",
       "      <td>10035</td>\n",
       "      <td>30</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:15:45</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>830e4b02f0bc0e18</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ws7e</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125886</th>\n",
       "      <td>126097</td>\n",
       "      <td>10035</td>\n",
       "      <td>1</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>20:43:45</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126722</th>\n",
       "      <td>126934</td>\n",
       "      <td>10035</td>\n",
       "      <td>12</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:04:43</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>304224</th>\n",
       "      <td>304743</td>\n",
       "      <td>10035</td>\n",
       "      <td>6</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:47:51</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>304246</th>\n",
       "      <td>304765</td>\n",
       "      <td>10035</td>\n",
       "      <td>19</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:32:47</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>4cd4a3df70a9960b</td>\n",
       "      <td>171bc09eab02ee34</td>\n",
       "      <td>ws7f</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>305140</th>\n",
       "      <td>305661</td>\n",
       "      <td>10035</td>\n",
       "      <td>28</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>18:43:20</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>4cd4a3df70a9960b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>310344</th>\n",
       "      <td>310873</td>\n",
       "      <td>10035</td>\n",
       "      <td>18</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>07:48:32</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>310434</th>\n",
       "      <td>310964</td>\n",
       "      <td>10035</td>\n",
       "      <td>20</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:02:23</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>317309</th>\n",
       "      <td>317845</td>\n",
       "      <td>10035</td>\n",
       "      <td>30</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:15:46</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>830e4b02f0bc0e18</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ws7e</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>317407</th>\n",
       "      <td>317943</td>\n",
       "      <td>10035</td>\n",
       "      <td>28</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>18:43:22</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>4cd4a3df70a9960b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>324379</th>\n",
       "      <td>324924</td>\n",
       "      <td>10035</td>\n",
       "      <td>3</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19:19:52</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>324747</th>\n",
       "      <td>325292</td>\n",
       "      <td>10035</td>\n",
       "      <td>26</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:12:01</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>9c9d49eddb6a59c3</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>331550</th>\n",
       "      <td>332102</td>\n",
       "      <td>10035</td>\n",
       "      <td>8</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>08:40:21</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>ef45c765457dc4d8</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>f6a53982aad75bd1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>331604</th>\n",
       "      <td>332156</td>\n",
       "      <td>10035</td>\n",
       "      <td>4</td>\n",
       "      <td>d25caee90b27fa9b</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:14:16</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>e00ae8763b66ee77</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ac0d0c1656f88205</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>uxcr</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>339864</th>\n",
       "      <td>340433</td>\n",
       "      <td>10035</td>\n",
       "      <td>15</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:56:25</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>344200</th>\n",
       "      <td>344778</td>\n",
       "      <td>10035</td>\n",
       "      <td>7</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>09:42:41</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>05dd573523e07add</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>9dbc42145670295e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>344789</th>\n",
       "      <td>345367</td>\n",
       "      <td>10035</td>\n",
       "      <td>14</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>18:58:09</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>345970</th>\n",
       "      <td>346549</td>\n",
       "      <td>10035</td>\n",
       "      <td>15</td>\n",
       "      <td>d25caee90b27fa9b</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:56:51</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>e00ae8763b66ee77</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ac0d0c1656f88205</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>uxcr</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>347366</th>\n",
       "      <td>347948</td>\n",
       "      <td>10035</td>\n",
       "      <td>13</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:45:16</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>349756</th>\n",
       "      <td>350346</td>\n",
       "      <td>10035</td>\n",
       "      <td>17</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:41:12</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>60adaa223ad17ead</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>350126</th>\n",
       "      <td>350716</td>\n",
       "      <td>10035</td>\n",
       "      <td>22</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17:40:38</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>366200</th>\n",
       "      <td>366810</td>\n",
       "      <td>10035</td>\n",
       "      <td>22</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>17:40:38</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>afab1706b871ffab</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>8ef6f3daeffdbe3d</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367314</th>\n",
       "      <td>367928</td>\n",
       "      <td>10035</td>\n",
       "      <td>8</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>08:40:21</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>ef45c765457dc4d8</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>f6a53982aad75bd1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367737</th>\n",
       "      <td>368351</td>\n",
       "      <td>10035</td>\n",
       "      <td>6</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:47:49</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>368187</th>\n",
       "      <td>368801</td>\n",
       "      <td>10035</td>\n",
       "      <td>16</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>11:02:15</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>63a515086d271fef</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>a84ec0b4d284c28e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>381770</th>\n",
       "      <td>382399</td>\n",
       "      <td>10035</td>\n",
       "      <td>3</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:25:46</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>171bc09eab02ee34</td>\n",
       "      <td>ws7f</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>384971</th>\n",
       "      <td>385606</td>\n",
       "      <td>10035</td>\n",
       "      <td>20</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>22:02:25</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>1ca60c14d6ae442b</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>385275</th>\n",
       "      <td>385910</td>\n",
       "      <td>10035</td>\n",
       "      <td>16</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>11:02:15</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>63a515086d271fef</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>a84ec0b4d284c28e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>393373</th>\n",
       "      <td>394017</td>\n",
       "      <td>10035</td>\n",
       "      <td>4</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:13:58</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>404219</th>\n",
       "      <td>404879</td>\n",
       "      <td>10035</td>\n",
       "      <td>4</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>13:08:31</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>c6c6712333efe9c3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>e58e48fb9215116e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>408405</th>\n",
       "      <td>409073</td>\n",
       "      <td>10035</td>\n",
       "      <td>1</td>\n",
       "      <td>d25caee90b27fa9b</td>\n",
       "      <td>1.0</td>\n",
       "      <td>20:44:15</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>97aeb123fafe5672</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>408616</th>\n",
       "      <td>409285</td>\n",
       "      <td>10035</td>\n",
       "      <td>13</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:45:16</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>47f70286272f2f0d</td>\n",
       "      <td>90a50ea267f6ef45</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>77aa94e2b65e0d4e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>410636</th>\n",
       "      <td>411307</td>\n",
       "      <td>10035</td>\n",
       "      <td>16</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>11:02:18</td>\n",
       "      <td>102.0</td>\n",
       "      <td>7.0.9</td>\n",
       "      <td>49dd36968dbfadda</td>\n",
       "      <td>OPPO R11</td>\n",
       "      <td>ecb58082e0e9b8e2</td>\n",
       "      <td>00fa2e4ba95605ef</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>a8dc52f65085212e</td>\n",
       "      <td>63a515086d271fef</td>\n",
       "      <td>64adc604e1123cdd</td>\n",
       "      <td>ws7g</td>\n",
       "      <td>a84ec0b4d284c28e</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>112 rows × 20 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         index    UID  day              mode  success      time     os  \\\n",
       "0            0  10035   30  c8741ce15ceac2a4      1.0  17:51:50  102.0   \n",
       "5077      5085  10035   27  c8741ce15ceac2a4      1.0  09:01:41  102.0   \n",
       "13497    13524  10035   27  c8741ce15ceac2a4      1.0  09:01:39  102.0   \n",
       "22298    22344  10035    1  c8741ce15ceac2a4      1.0  20:43:44  102.0   \n",
       "22598    22644  10035   26  c8741ce15ceac2a4      1.0  12:12:01  102.0   \n",
       "23092    23138  10035    3  c8741ce15ceac2a4      1.0  19:19:54  102.0   \n",
       "39896    39969  10035   30  c8741ce15ceac2a4      1.0  13:15:45  102.0   \n",
       "48575    48660  10035   10  c8741ce15ceac2a4      1.0  14:06:28  102.0   \n",
       "50839    50925  10035   23  c8741ce15ceac2a4      1.0  21:31:38  102.0   \n",
       "53422    53511  10035   10  c8741ce15ceac2a4      1.0  14:06:28  102.0   \n",
       "55066    55158  10035   27  c8741ce15ceac2a4      1.0  09:01:39  102.0   \n",
       "63815    63922  10035   15  c8741ce15ceac2a4      1.0  13:56:25  102.0   \n",
       "70326    70442  10035    6  c8741ce15ceac2a4      1.0  22:47:49  102.0   \n",
       "74223    74347  10035   22  c8741ce15ceac2a4      1.0  17:40:38  102.0   \n",
       "74486    74611  10035   14  c8741ce15ceac2a4      1.0  18:58:07  102.0   \n",
       "78036    78168  10035   18  c8741ce15ceac2a4      1.0  07:48:32  102.0   \n",
       "82847    82985  10035   27  c8741ce15ceac2a4      1.0  07:34:17  102.0   \n",
       "85111    85253  10035   30  c8741ce15ceac2a4      1.0  17:51:50  102.0   \n",
       "87896    88042  10035    8  c8741ce15ceac2a4      1.0  08:40:18  102.0   \n",
       "98988    99152  10035   10  c8741ce15ceac2a4      1.0  14:06:28  102.0   \n",
       "100136  100303  10035   17  c8741ce15ceac2a4      1.0  13:41:14  102.0   \n",
       "102732  102908  10035    3  c8741ce15ceac2a4      1.0  19:19:53  102.0   \n",
       "105984  106165  10035   14  c8741ce15ceac2a4      1.0  18:58:07  102.0   \n",
       "112655  112847  10035   27  c8741ce15ceac2a4      1.0  07:34:16  102.0   \n",
       "120066  120268  10035   27  c8741ce15ceac2a4      1.0  09:01:41  102.0   \n",
       "123381  123590  10035   20  c8741ce15ceac2a4      1.0  22:02:23  102.0   \n",
       "123461  123670  10035   12  c8741ce15ceac2a4      1.0  14:04:44  102.0   \n",
       "125436  125647  10035   30  c8741ce15ceac2a4      1.0  13:15:45  102.0   \n",
       "125886  126097  10035    1  c8741ce15ceac2a4      1.0  20:43:45  102.0   \n",
       "126722  126934  10035   12  c8741ce15ceac2a4      1.0  14:04:43  102.0   \n",
       "...        ...    ...  ...               ...      ...       ...    ...   \n",
       "304224  304743  10035    6  c8741ce15ceac2a4      1.0  22:47:51  102.0   \n",
       "304246  304765  10035   19  c8741ce15ceac2a4      1.0  13:32:47  102.0   \n",
       "305140  305661  10035   28  c8741ce15ceac2a4      1.0  18:43:20  102.0   \n",
       "310344  310873  10035   18  c8741ce15ceac2a4      1.0  07:48:32  102.0   \n",
       "310434  310964  10035   20  c8741ce15ceac2a4      1.0  22:02:23  102.0   \n",
       "317309  317845  10035   30  c8741ce15ceac2a4      1.0  13:15:46  102.0   \n",
       "317407  317943  10035   28  c8741ce15ceac2a4      1.0  18:43:22  102.0   \n",
       "324379  324924  10035    3  c8741ce15ceac2a4      1.0  19:19:52  102.0   \n",
       "324747  325292  10035   26  c8741ce15ceac2a4      1.0  12:12:01  102.0   \n",
       "331550  332102  10035    8  c8741ce15ceac2a4      1.0  08:40:21  102.0   \n",
       "331604  332156  10035    4  d25caee90b27fa9b      1.0  13:14:16  102.0   \n",
       "339864  340433  10035   15  c8741ce15ceac2a4      1.0  13:56:25  102.0   \n",
       "344200  344778  10035    7  c8741ce15ceac2a4      1.0  09:42:41  102.0   \n",
       "344789  345367  10035   14  c8741ce15ceac2a4      1.0  18:58:09  102.0   \n",
       "345970  346549  10035   15  d25caee90b27fa9b      1.0  13:56:51  102.0   \n",
       "347366  347948  10035   13  c8741ce15ceac2a4      1.0  12:45:16  102.0   \n",
       "349756  350346  10035   17  c8741ce15ceac2a4      1.0  13:41:12  102.0   \n",
       "350126  350716  10035   22  c8741ce15ceac2a4      1.0  17:40:38  102.0   \n",
       "366200  366810  10035   22  c8741ce15ceac2a4      1.0  17:40:38  102.0   \n",
       "367314  367928  10035    8  c8741ce15ceac2a4      1.0  08:40:21  102.0   \n",
       "367737  368351  10035    6  c8741ce15ceac2a4      1.0  22:47:49  102.0   \n",
       "368187  368801  10035   16  c8741ce15ceac2a4      1.0  11:02:15  102.0   \n",
       "381770  382399  10035    3  c8741ce15ceac2a4      1.0  12:25:46  102.0   \n",
       "384971  385606  10035   20  c8741ce15ceac2a4      1.0  22:02:25  102.0   \n",
       "385275  385910  10035   16  c8741ce15ceac2a4      1.0  11:02:15  102.0   \n",
       "393373  394017  10035    4  c8741ce15ceac2a4      1.0  13:13:58  102.0   \n",
       "404219  404879  10035    4  c8741ce15ceac2a4      1.0  13:08:31  102.0   \n",
       "408405  409073  10035    1  d25caee90b27fa9b      1.0  20:44:15  102.0   \n",
       "408616  409285  10035   13  c8741ce15ceac2a4      1.0  12:45:16  102.0   \n",
       "410636  411307  10035   16  c8741ce15ceac2a4      1.0  11:02:18  102.0   \n",
       "\n",
       "       version           device1   device2      device_code1  \\\n",
       "0        7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "5077     7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "13497    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "22298    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "22598    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "23092    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "39896    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "48575    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "50839    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "53422    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "55066    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "63815    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "70326    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "74223    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "74486    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "78036    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "82847    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "85111    7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "87896    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "98988    7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "100136   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "102732   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "105984   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "112655   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "120066   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "123381   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "123461   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "125436   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "125886   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "126722   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "...        ...               ...       ...               ...   \n",
       "304224   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "304246   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "305140   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "310344   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "310434   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "317309   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "317407   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "324379   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "324747   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "331550   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "331604   7.0.5  e00ae8763b66ee77       NaN  ecb58082e0e9b8e2   \n",
       "339864   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "344200   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "344789   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "345970   7.0.9  e00ae8763b66ee77       NaN  ecb58082e0e9b8e2   \n",
       "347366   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "349756   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "350126   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "366200   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "367314   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "367737   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "368187   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "381770   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "384971   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "385275   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "393373   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "404219   7.0.5  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "408405   7.0.5  49dd36968dbfadda       NaN  ecb58082e0e9b8e2   \n",
       "408616   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "410636   7.0.9  49dd36968dbfadda  OPPO R11  ecb58082e0e9b8e2   \n",
       "\n",
       "            device_code2 device_code3              mac1              mac2  \\\n",
       "0       00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "5077    60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "13497   60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "22298   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "22598   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "23092   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "39896   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "48575   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "50839   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "53422   60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "55066   60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "63815   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "70326   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "74223   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "74486   60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "78036   60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "82847   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "85111   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "87896   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "98988   00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "100136  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "102732  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "105984  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "112655  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "120066  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "123381  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "123461  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "125436  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "125886  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "126722  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "...                  ...          ...               ...               ...   \n",
       "304224  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "304246  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "305140  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "310344  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "310434  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "317309  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "317407  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "324379  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "324747  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "331550  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "331604  00fa2e4ba95605ef          NaN  ac0d0c1656f88205  a8dc52f65085212e   \n",
       "339864  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "344200  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "344789  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "345970  00fa2e4ba95605ef          NaN  ac0d0c1656f88205  a8dc52f65085212e   \n",
       "347366  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "349756  60adaa223ad17ead          NaN               NaN  a8dc52f65085212e   \n",
       "350126  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "366200  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "367314  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "367737  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "368187  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "381770  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "384971  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "385275  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "393373  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "404219  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "408405  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "408616  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "410636  00fa2e4ba95605ef          NaN               NaN  a8dc52f65085212e   \n",
       "\n",
       "                     ip1              wifi geo_code           ip1_sub  Tag  \n",
       "0       55dd8936655c86f6               NaN     wskx  e58e48fb9215116e    0  \n",
       "5077    afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "13497   afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "22298   97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "22598   9c9d49eddb6a59c3  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "23092   97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "39896   830e4b02f0bc0e18               NaN     ws7e  e58e48fb9215116e    0  \n",
       "48575   47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "50839   1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "53422   47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "55066   afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "63815   47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "70326   97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "74223   afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "74486   47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "78036   1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "82847   4cd4a3df70a9960b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "85111   55dd8936655c86f6               NaN     wskx  e58e48fb9215116e    0  \n",
       "87896   ef45c765457dc4d8  64adc604e1123cdd     ws7g  f6a53982aad75bd1    0  \n",
       "98988   47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "100136  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "102732  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "105984  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "112655  4cd4a3df70a9960b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "120066  afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "123381  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "123461  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "125436  830e4b02f0bc0e18               NaN     ws7e  e58e48fb9215116e    0  \n",
       "125886  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "126722  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "...                  ...               ...      ...               ...  ...  \n",
       "304224  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "304246  4cd4a3df70a9960b  171bc09eab02ee34     ws7f  77aa94e2b65e0d4e    0  \n",
       "305140  4cd4a3df70a9960b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "310344  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "310434  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "317309  830e4b02f0bc0e18               NaN     ws7e  e58e48fb9215116e    0  \n",
       "317407  4cd4a3df70a9960b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "324379  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "324747  9c9d49eddb6a59c3  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "331550  ef45c765457dc4d8  64adc604e1123cdd     ws7g  f6a53982aad75bd1    0  \n",
       "331604               NaN               NaN     uxcr               NaN    0  \n",
       "339864  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "344200  05dd573523e07add  64adc604e1123cdd     ws7g  9dbc42145670295e    0  \n",
       "344789  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "345970               NaN               NaN     uxcr               NaN    0  \n",
       "347366  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "349756  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "350126  afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "366200  afab1706b871ffab  64adc604e1123cdd     ws7g  8ef6f3daeffdbe3d    0  \n",
       "367314  ef45c765457dc4d8  64adc604e1123cdd     ws7g  f6a53982aad75bd1    0  \n",
       "367737  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "368187  63a515086d271fef  64adc604e1123cdd     ws7g  a84ec0b4d284c28e    0  \n",
       "381770  47f70286272f2f0d  171bc09eab02ee34     ws7f  77aa94e2b65e0d4e    0  \n",
       "384971  1ca60c14d6ae442b  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "385275  63a515086d271fef  64adc604e1123cdd     ws7g  a84ec0b4d284c28e    0  \n",
       "393373  97aeb123fafe5672  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "404219  c6c6712333efe9c3               NaN     ws7g  e58e48fb9215116e    0  \n",
       "408405  97aeb123fafe5672               NaN     ws7g  77aa94e2b65e0d4e    0  \n",
       "408616  47f70286272f2f0d  90a50ea267f6ef45     ws7g  77aa94e2b65e0d4e    0  \n",
       "410636  63a515086d271fef  64adc604e1123cdd     ws7g  a84ec0b4d284c28e    0  \n",
       "\n",
       "[112 rows x 20 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_trs[train_op_trs.UID == 10035]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# mode字段的相关分析与提取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''平均每天不同的code的次数'''\n",
    "train_mode = train_op_trs.drop_duplicates(subset=['UID','day', 'mode'])\n",
    "\n",
    "a = train_mode['mode'].value_counts().index.tolist()\n",
    "b = [i+1 for i in range(15)] + ([-1]*(len(a) - 15))\n",
    "dicts = dict(zip(a,b))\n",
    "train_mode['mode'] = train_mode['mode'].map(dicts)\n",
    "\n",
    "temp = train_mode.groupby(['UID', 'mode'])['day'].count()\n",
    "temp = temp.unstack('mode').reset_index()\n",
    "cols = temp.columns.tolist()\n",
    "temp.columns = cols\n",
    "temp.columns = [temp.columns[0]] + ['mode'+'_'+ str(i) for i in temp.columns[1:]]\n",
    "temp.fillna(0,inplace=True)\n",
    "train_op_feature = pd.merge(train_op_feature, temp, on='UID', how='left')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 操作成功率与失败率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''操作的成功率以及失败率以及缺失率'''\n",
    "train_success = train_op_trs.copy()\n",
    "train_success['success'].fillna(2, inplace=True)\n",
    "train_success.success = train_success.success.astype(int)\n",
    "train_success = pd.concat([train_success.UID, pd.get_dummies(train_success.success).add_prefix('success_')], axis=1)\n",
    "success_func = lambda x: x.sum() / x.count()\n",
    "train_success = train_success.groupby('UID', as_index=False).agg(success_func)\n",
    "train_op_feature = pd.merge(train_op_feature, train_success, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# time处理方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''统计每个不同时间段的交易次数，以及每个用户每个时间段的平均交易次数'''\n",
    "train_time = train_op_trs.copy()\n",
    "train_time.time = train_time.time.str[:2]\n",
    "\n",
    "train_time.time = train_time.time.astype('int')\n",
    "\n",
    "def time_help(data):\n",
    "    if (data > 7) & (data <= 12):\n",
    "        return 0\n",
    "    elif (data > 12) & (data <= 19):\n",
    "        return 1\n",
    "    elif (data > 19) & (data <= 24):\n",
    "        return 2\n",
    "    elif (data >= 0) & (data <= 7):\n",
    "        return 3\n",
    "\n",
    "train_time.time = train_time.time.map(time_help)\n",
    "train_time = pd.concat([train_time.UID, pd.get_dummies(train_time.time, prefix='time_op')], axis=1)\n",
    "train_time = train_time.groupby('UID', as_index=False).sum()\n",
    "train_op_feature = pd.merge(train_op_feature, train_time, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# os操作系统的处理分析方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[102.0, 200.0, 103.0, 101.0]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_trs.os.unique().tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 101 不知道是什么操作系统的情况\n",
    "# 102 安卓手机\n",
    "# 103 苹果系列手机\n",
    "# 104 电脑操作\n",
    "# 105 电脑操作 +  mode=”8e463287d7146285 ”强操作，一定为欺诈用户\n",
    "# 107 大部分电脑操作 + mode=‘d25caee90b27fa9b ’强操作， 一定为欺诈用户\n",
    "# "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''统计用户一共有多少个操作系统以及每多少天换一个操作系统'''\n",
    "train_os = train_op_trs.copy()\n",
    "train_os.drop_duplicates(subset=['UID', 'os'], inplace=True)\n",
    "train_os = train_os.groupby('UID', as_index=False).os.count()\n",
    "train_op_feature = pd.merge(train_op_feature, train_os, on='UID', how='left')\n",
    "'''平均一天的操作系统的个数'''\n",
    "train_os_day = train_op_trs.copy()\n",
    "train_os_day.drop_duplicates(subset=['UID', 'day', 'os'], inplace=True)\n",
    "train_os_day = train_os_day.groupby('UID', as_index=False).os.agg({'os_day':'count'})\n",
    "train_op_feature = pd.merge(train_op_feature, train_os_day, on='UID', how='left')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 是否为苹果手机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''是否wie苹果手机的判断'''\n",
    "train_apple = train_op_trs.copy()\n",
    "train_apple.device_code3 = train_apple.device_code3.fillna(0)\n",
    "train_apple.device_code1 = train_apple.device_code1.fillna(0)\n",
    "\n",
    "train_apple.device_code3= train_apple.device_code3.apply(lambda x: x if x == 0 else 1)\n",
    "train_apple.device_code1 = train_apple.device_code1.apply(lambda x: x if x == 0 else 1)\n",
    "\n",
    "train_apple = train_apple.groupby('UID', as_index=False)[['device_code1', 'device_code3']].sum()\n",
    "train_apple['is_apple'] = np.where(train_apple.device_code1 > train_apple.device_code3, 0,1)\n",
    "train_apple.drop(['device_code1', 'device_code3'], axis=1, inplace=True)\n",
    "train_op_feature = pd.merge(train_op_feature, train_apple, on='UID', how='left')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 同一个用户不同的设备个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''y用户设备的个数以及每天不同设备的个数'''\n",
    "train_device = train_op_trs.copy()\n",
    "\n",
    "train_device.device2 = train_device.device2.fillna(1)\n",
    "\n",
    "train_device1 = train_device.groupby(['UID', 'device2'], as_index=False).count()\n",
    "train_device1 = train_device1.groupby(['UID'], as_index=False)['device2'].agg({'device_count':'count'})\n",
    "train_op_feature = pd.merge(train_op_feature, train_device1, on='UID', how='left')\n",
    "\n",
    "train_device_day = train_device.groupby(['UID','day', 'device2'], as_index=False).count()\n",
    "train_device_day = train_device_day.groupby(['UID'], as_index=False)['device2'].agg({'device_day':'count'})\n",
    "train_op_feature = pd.merge(train_op_feature, train_device_day, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# mac1分析的个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>UID</th>\n",
       "      <th>day</th>\n",
       "      <th>mode</th>\n",
       "      <th>success</th>\n",
       "      <th>time</th>\n",
       "      <th>os</th>\n",
       "      <th>version</th>\n",
       "      <th>device1</th>\n",
       "      <th>device2</th>\n",
       "      <th>device_code1</th>\n",
       "      <th>device_code2</th>\n",
       "      <th>device_code3</th>\n",
       "      <th>mac1</th>\n",
       "      <th>mac2</th>\n",
       "      <th>ip1</th>\n",
       "      <th>wifi</th>\n",
       "      <th>geo_code</th>\n",
       "      <th>ip1_sub</th>\n",
       "      <th>Tag</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>87361</th>\n",
       "      <td>87507</td>\n",
       "      <td>10000</td>\n",
       "      <td>13</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:20:56</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31599eec867ba9c7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ee08d48e73120da4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96783</th>\n",
       "      <td>96940</td>\n",
       "      <td>10000</td>\n",
       "      <td>26</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:23:48</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.7</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34c715882de1a508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1e3ea9498c461cbf</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>150225</th>\n",
       "      <td>150480</td>\n",
       "      <td>10000</td>\n",
       "      <td>26</td>\n",
       "      <td>d25caee90b27fa9b</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:24:21</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.7</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34c715882de1a508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1e3ea9498c461cbf</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167927</th>\n",
       "      <td>168206</td>\n",
       "      <td>10000</td>\n",
       "      <td>26</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:23:48</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.7</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34c715882de1a508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1e3ea9498c461cbf</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196034</th>\n",
       "      <td>196361</td>\n",
       "      <td>10000</td>\n",
       "      <td>26</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:23:48</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.7</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34c715882de1a508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1e3ea9498c461cbf</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>216377</th>\n",
       "      <td>216744</td>\n",
       "      <td>10000</td>\n",
       "      <td>13</td>\n",
       "      <td>270ca3ca8f0d1126</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:22:59</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31599eec867ba9c7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ee08d48e73120da4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>306862</th>\n",
       "      <td>307385</td>\n",
       "      <td>10000</td>\n",
       "      <td>13</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:20:56</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31599eec867ba9c7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ee08d48e73120da4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>338847</th>\n",
       "      <td>339411</td>\n",
       "      <td>10000</td>\n",
       "      <td>26</td>\n",
       "      <td>d25caee90b27fa9b</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12:24:01</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.7</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34c715882de1a508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1e3ea9498c461cbf</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>419495</th>\n",
       "      <td>420183</td>\n",
       "      <td>10000</td>\n",
       "      <td>13</td>\n",
       "      <td>c8741ce15ceac2a4</td>\n",
       "      <td>1.0</td>\n",
       "      <td>14:20:56</td>\n",
       "      <td>103.0</td>\n",
       "      <td>7.0.5</td>\n",
       "      <td>aca4977fbe8741e1</td>\n",
       "      <td>IPHONE 5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>deb68f7028682008</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31599eec867ba9c7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ee08d48e73120da4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         index    UID  day              mode  success      time     os  \\\n",
       "87361    87507  10000   13  c8741ce15ceac2a4      1.0  14:20:56  103.0   \n",
       "96783    96940  10000   26  c8741ce15ceac2a4      1.0  12:23:48  103.0   \n",
       "150225  150480  10000   26  d25caee90b27fa9b      1.0  12:24:21  103.0   \n",
       "167927  168206  10000   26  c8741ce15ceac2a4      1.0  12:23:48  103.0   \n",
       "196034  196361  10000   26  c8741ce15ceac2a4      1.0  12:23:48  103.0   \n",
       "216377  216744  10000   13  270ca3ca8f0d1126      1.0  14:22:59  103.0   \n",
       "306862  307385  10000   13  c8741ce15ceac2a4      1.0  14:20:56  103.0   \n",
       "338847  339411  10000   26  d25caee90b27fa9b      1.0  12:24:01  103.0   \n",
       "419495  420183  10000   13  c8741ce15ceac2a4      1.0  14:20:56  103.0   \n",
       "\n",
       "       version           device1   device2 device_code1 device_code2  \\\n",
       "87361    7.0.5  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "96783    7.0.7  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "150225   7.0.7  aca4977fbe8741e1       NaN          NaN          NaN   \n",
       "167927   7.0.7  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "196034   7.0.7  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "216377   7.0.5  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "306862   7.0.5  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "338847   7.0.7  aca4977fbe8741e1       NaN          NaN          NaN   \n",
       "419495   7.0.5  aca4977fbe8741e1  IPHONE 5          NaN          NaN   \n",
       "\n",
       "            device_code3 mac1 mac2               ip1 wifi geo_code  \\\n",
       "87361   deb68f7028682008  NaN  NaN  31599eec867ba9c7  NaN      NaN   \n",
       "96783   deb68f7028682008  NaN  NaN  34c715882de1a508  NaN      NaN   \n",
       "150225  deb68f7028682008  NaN  NaN  34c715882de1a508  NaN      NaN   \n",
       "167927  deb68f7028682008  NaN  NaN  34c715882de1a508  NaN      NaN   \n",
       "196034  deb68f7028682008  NaN  NaN  34c715882de1a508  NaN      NaN   \n",
       "216377  deb68f7028682008  NaN  NaN  31599eec867ba9c7  NaN      NaN   \n",
       "306862  deb68f7028682008  NaN  NaN  31599eec867ba9c7  NaN      NaN   \n",
       "338847  deb68f7028682008  NaN  NaN  34c715882de1a508  NaN      NaN   \n",
       "419495  deb68f7028682008  NaN  NaN  31599eec867ba9c7  NaN      NaN   \n",
       "\n",
       "                 ip1_sub  Tag  \n",
       "87361   ee08d48e73120da4    1  \n",
       "96783   1e3ea9498c461cbf    1  \n",
       "150225  1e3ea9498c461cbf    1  \n",
       "167927  1e3ea9498c461cbf    1  \n",
       "196034  1e3ea9498c461cbf    1  \n",
       "216377  ee08d48e73120da4    1  \n",
       "306862  ee08d48e73120da4    1  \n",
       "338847  1e3ea9498c461cbf    1  \n",
       "419495  ee08d48e73120da4    1  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_trs[train_op_trs.UID == 10000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''统计用户mac地址的个数'''\n",
    "train_mac = train_op_trs.copy()\n",
    "train_mac.mac1 = train_mac.mac1.fillna(0)\n",
    "train_mac = train_mac.groupby(['UID', 'mac1'], as_index=False)['day'].agg({'mac_count':'count'})\n",
    "train_mac['ratio'] = np.where(train_mac.mac1 == 0, 0, 1)\n",
    "train_mac_count = train_mac.groupby('UID', as_index=False)['mac1'].count()\n",
    "train_op_feature = pd.merge(train_op_feature, train_mac_count, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''统计mac地址的缺失率'''\n",
    "train_mac_loss = train_op_trs.groupby('UID', as_index=False).count()\n",
    "train_mac_loss['mac_loss'] = train_mac_loss.mac1 / train_mac_loss.day\n",
    "train_mac_loss = train_mac_loss[['UID', 'mac_loss']]\n",
    "train_op_feature = pd.merge(train_op_feature, train_mac_loss, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# weifi分析,统计weifi个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''wifi的个数以及每天不同的wifi的个数'''\n",
    "train_wifi = train_op_trs.copy()\n",
    "train_wifi.wifi = train_wifi.wifi.fillna(0)\n",
    "\n",
    "train_wifi1 = train_wifi.drop_duplicates(subset=['UID', 'wifi'])\n",
    "train_wifi1 = train_wifi1.groupby('UID', as_index=False).wifi.count()\n",
    "train_op_feature = pd.merge(train_op_feature, train_wifi1, on='UID', how='left')\n",
    "'''平均一天的操作系统的个数'''\n",
    "train_wifi_day  = train_wifi.drop_duplicates(subset=['UID', 'day', 'wifi'])\n",
    "train_wifi_day = train_wifi_day.groupby('UID', as_index=False).wifi.agg({'wifi_day':'count'})\n",
    "train_op_feature = pd.merge(train_op_feature, train_wifi_day, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_is_wefi = train_op_trs.copy()\n",
    "train_is_wefi.wifi = train_is_wefi.wifi.fillna(0)\n",
    "train_is_wefi['wefi_loss'] = np.where(train_is_wefi.wifi == 0, 0, 1)\n",
    "\n",
    "# train_is_wefi.groupby('UID').apply(lambda x: len(x[x['wefi_loss'] == 0]) / len(x)).reset_index()\n",
    "\n",
    "funcs = lambda x: x[x == 0].count() / x.count()\n",
    "train_is_wefi = train_is_wefi.groupby('UID', as_index=False).agg({'wefi_loss':funcs})\n",
    "train_op_feature = pd.merge(train_op_feature, train_is_wefi, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# geo_code地理位置的分析与处理,提取每天地理位置的变化情况，以及地理位置缺失率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_geo_wud = train_op_trs.copy()\n",
    "train_geo_wud.geo_code = train_geo_wud.geo_code.str[:2]\n",
    "def fucs_geo_code_wu(x):\n",
    "    temp = x.values.tolist()\n",
    "    if  ('wu' in temp) :\n",
    "        return 1\n",
    "    else:\n",
    "        return 0\n",
    "def fucs_geo_code_wd(x):\n",
    "    temp = x.values.tolist()\n",
    "    if  ('wd' in temp) :\n",
    "        return 1\n",
    "    else:\n",
    "        return 0\n",
    "train_geo_wu = train_geo_wud.groupby('UID')['geo_code'].apply(fucs_geo_code_wu).reset_index().rename(\n",
    "    {\"geo_code\":'geo_code_wu'}, axis=1)\n",
    "train_geo_wd = train_geo_wud.groupby('UID')['geo_code'].apply(fucs_geo_code_wd).reset_index().rename(\n",
    "    {\"geo_code\":'geo_code_wd'}, axis=1)\n",
    "train_op_feature = train_op_feature.merge(train_geo_wu, on='UID', how='left')\n",
    "train_op_feature = train_op_feature.merge(train_geo_wd, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "train_geo = train_op_trs.copy()\n",
    "train_geo.geo_code = train_geo.geo_code.fillna(0)\n",
    "train_geo = train_geo.drop_duplicates(subset=['UID', 'day', 'geo_code'],keep='first')\n",
    "train_geo = train_geo.groupby(['UID', 'day'], as_index=False)['geo_code'].count()\n",
    "train_geo = train_geo.groupby('UID', as_index=False).agg({'day':'count', 'geo_code':'sum'})\n",
    "train_geo['avg_day_geo'] = train_geo['geo_code'] / train_geo['day']\n",
    "train_geo.drop(['day', 'geo_code'], axis=1, inplace=True)\n",
    "train_op_feature = pd.merge(train_op_feature, train_geo, on='UID', how='left')\n",
    "\n",
    "train_is_geo = train_op_trs.copy()\n",
    "train_is_geo.geo_code = train_is_geo.geo_code.fillna(0)\n",
    "train_is_geo['geo_loss'] = np.where(train_is_geo.geo_code == 0, 0, 1)\n",
    "\n",
    "funcs = lambda x: x[x == 0].count() / x.count()\n",
    "train_is_geo = train_is_geo.groupby('UID', as_index=False).agg({'geo_loss':funcs})\n",
    "train_op_feature = pd.merge(train_op_feature, train_is_geo, on='UID', how='left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 平均化特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UID</th>\n",
       "      <th>Tag</th>\n",
       "      <th>op_count</th>\n",
       "      <th>day_count_op</th>\n",
       "      <th>mode_-1</th>\n",
       "      <th>mode_1</th>\n",
       "      <th>mode_2</th>\n",
       "      <th>mode_3</th>\n",
       "      <th>mode_4</th>\n",
       "      <th>mode_5</th>\n",
       "      <th>...</th>\n",
       "      <th>device_day</th>\n",
       "      <th>mac1</th>\n",
       "      <th>mac_loss</th>\n",
       "      <th>wifi</th>\n",
       "      <th>wifi_day</th>\n",
       "      <th>wefi_loss</th>\n",
       "      <th>geo_code_wu</th>\n",
       "      <th>geo_code_wd</th>\n",
       "      <th>avg_day_geo</th>\n",
       "      <th>geo_loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10035</td>\n",
       "      <td>0</td>\n",
       "      <td>112</td>\n",
       "      <td>23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>26</td>\n",
       "      <td>2</td>\n",
       "      <td>0.017857</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>0.125000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.217391</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>16264</td>\n",
       "      <td>0</td>\n",
       "      <td>241</td>\n",
       "      <td>21</td>\n",
       "      <td>22.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>37</td>\n",
       "      <td>3</td>\n",
       "      <td>0.033195</td>\n",
       "      <td>3</td>\n",
       "      <td>39</td>\n",
       "      <td>0.539419</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.761905</td>\n",
       "      <td>0.356846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13162</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>0.117647</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>0.823529</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.333333</td>\n",
       "      <td>0.235294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>21392</td>\n",
       "      <td>0</td>\n",
       "      <td>49</td>\n",
       "      <td>9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>14</td>\n",
       "      <td>2</td>\n",
       "      <td>0.020408</td>\n",
       "      <td>2</td>\n",
       "      <td>11</td>\n",
       "      <td>0.714286</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>18599</td>\n",
       "      <td>1</td>\n",
       "      <td>179</td>\n",
       "      <td>13</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "      <td>13</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 41 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     UID  Tag  op_count  day_count_op  mode_-1  mode_1  mode_2  mode_3  \\\n",
       "0  10035    0       112            23      0.0    23.0     3.0     0.0   \n",
       "1  16264    0       241            21     22.0    21.0     9.0     0.0   \n",
       "2  13162    0        17             3      1.0     2.0     2.0     1.0   \n",
       "3  21392    0        49             9      0.0     9.0     5.0     1.0   \n",
       "4  18599    1       179            13      0.0     0.0    12.0    13.0   \n",
       "\n",
       "   mode_4  mode_5    ...     device_day  mac1  mac_loss  wifi  wifi_day  \\\n",
       "0     0.0     0.0    ...             26     2  0.017857     4        28   \n",
       "1     0.0     1.0    ...             37     3  0.033195     3        39   \n",
       "2     0.0     1.0    ...              5     2  0.117647     3         4   \n",
       "3     0.0     0.0    ...             14     2  0.020408     2        11   \n",
       "4     0.0    13.0    ...             13     1  0.000000     1        13   \n",
       "\n",
       "   wefi_loss  geo_code_wu  geo_code_wd  avg_day_geo  geo_loss  \n",
       "0   0.125000            0            0     1.217391  0.000000  \n",
       "1   0.539419            0            0     1.761905  0.356846  \n",
       "2   0.823529            0            0     1.333333  0.235294  \n",
       "3   0.714286            0            0     1.000000  0.000000  \n",
       "4   1.000000            0            0     1.000000  1.000000  \n",
       "\n",
       "[5 rows x 41 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_feature.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['UID', 'Tag', 'op_count', 'day_count_op', 'mode_-1', 'mode_1', 'mode_2',\n",
       "       'mode_3', 'mode_4', 'mode_5', 'mode_6', 'mode_7', 'mode_8', 'mode_9',\n",
       "       'mode_10', 'mode_11', 'mode_12', 'mode_13', 'mode_14', 'mode_15',\n",
       "       'success_0', 'success_1', 'success_2', 'time_op_0', 'time_op_1',\n",
       "       'time_op_2', 'time_op_3', 'os', 'os_day', 'is_apple', 'device_count',\n",
       "       'device_day', 'mac1', 'mac_loss', 'wifi', 'wifi_day', 'wefi_loss',\n",
       "       'geo_code_wu', 'geo_code_wd', 'avg_day_geo', 'geo_loss'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_feature.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''对特征进行天数的平均话操作'''\n",
    "avg_clos = ['mode_-1', 'mode_1', 'mode_2',\n",
    "       'mode_3', 'mode_4', 'mode_5', 'mode_6', 'mode_7', 'mode_8', 'mode_9',\n",
    "       'mode_10', 'mode_11', 'mode_12', 'mode_13', 'mode_14', 'mode_15',\n",
    "       'success_0', 'success_1', 'success_2', 'time_op_0', 'time_op_1',\n",
    "       'time_op_2', 'time_op_3', 'os', 'os_day', 'device_count',\n",
    "       'device_day', 'mac1',\n",
    "       'wifi', 'wifi_day']\n",
    "\n",
    "for i in avg_clos:\n",
    "    train_op_feature['avg_op_{}'.format(i)] =  train_op_feature[i] /  train_op_feature['op_count']\n",
    "    train_op_feature['avg_op_day_{}'.format(i)] =  train_op_feature[i] /  train_op_feature['day_count_op']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 特征的保存"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# train_op_feature.to_csv('train_op_feature.csv', index=False, encoding='utf-8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UID</th>\n",
       "      <th>Tag</th>\n",
       "      <th>op_count</th>\n",
       "      <th>day_count_op</th>\n",
       "      <th>mode_-1</th>\n",
       "      <th>mode_1</th>\n",
       "      <th>mode_2</th>\n",
       "      <th>mode_3</th>\n",
       "      <th>mode_4</th>\n",
       "      <th>mode_5</th>\n",
       "      <th>...</th>\n",
       "      <th>avg_op_device_count</th>\n",
       "      <th>avg_op_day_device_count</th>\n",
       "      <th>avg_op_device_day</th>\n",
       "      <th>avg_op_day_device_day</th>\n",
       "      <th>avg_op_mac1</th>\n",
       "      <th>avg_op_day_mac1</th>\n",
       "      <th>avg_op_wifi</th>\n",
       "      <th>avg_op_day_wifi</th>\n",
       "      <th>avg_op_wifi_day</th>\n",
       "      <th>avg_op_day_wifi_day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10035</td>\n",
       "      <td>0</td>\n",
       "      <td>112</td>\n",
       "      <td>23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.017857</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.232143</td>\n",
       "      <td>1.130435</td>\n",
       "      <td>0.017857</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.035714</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.217391</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>16264</td>\n",
       "      <td>0</td>\n",
       "      <td>241</td>\n",
       "      <td>21</td>\n",
       "      <td>22.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.008299</td>\n",
       "      <td>0.095238</td>\n",
       "      <td>0.153527</td>\n",
       "      <td>1.761905</td>\n",
       "      <td>0.012448</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.012448</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.161826</td>\n",
       "      <td>1.857143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13162</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.176471</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.294118</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.117647</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.176471</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.235294</td>\n",
       "      <td>1.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>21392</td>\n",
       "      <td>0</td>\n",
       "      <td>49</td>\n",
       "      <td>9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.040816</td>\n",
       "      <td>0.222222</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>1.555556</td>\n",
       "      <td>0.040816</td>\n",
       "      <td>0.222222</td>\n",
       "      <td>0.040816</td>\n",
       "      <td>0.222222</td>\n",
       "      <td>0.224490</td>\n",
       "      <td>1.222222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>18599</td>\n",
       "      <td>1</td>\n",
       "      <td>179</td>\n",
       "      <td>13</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.005587</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.072626</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.005587</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.005587</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.072626</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20499</td>\n",
       "      <td>0</td>\n",
       "      <td>175</td>\n",
       "      <td>16</td>\n",
       "      <td>14.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.011429</td>\n",
       "      <td>0.125000</td>\n",
       "      <td>0.137143</td>\n",
       "      <td>1.500000</td>\n",
       "      <td>0.011429</td>\n",
       "      <td>0.125000</td>\n",
       "      <td>0.022857</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>1.562500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>21634</td>\n",
       "      <td>1</td>\n",
       "      <td>39</td>\n",
       "      <td>6</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.102564</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.205128</td>\n",
       "      <td>1.333333</td>\n",
       "      <td>0.205128</td>\n",
       "      <td>1.333333</td>\n",
       "      <td>0.102564</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.256410</td>\n",
       "      <td>1.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>11305</td>\n",
       "      <td>0</td>\n",
       "      <td>41</td>\n",
       "      <td>6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.048780</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.268293</td>\n",
       "      <td>1.833333</td>\n",
       "      <td>0.024390</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.073171</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.268293</td>\n",
       "      <td>1.833333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>15270</td>\n",
       "      <td>0</td>\n",
       "      <td>79</td>\n",
       "      <td>7</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.037975</td>\n",
       "      <td>0.428571</td>\n",
       "      <td>0.164557</td>\n",
       "      <td>1.857143</td>\n",
       "      <td>0.025316</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>0.037975</td>\n",
       "      <td>0.428571</td>\n",
       "      <td>0.139241</td>\n",
       "      <td>1.571429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10655</td>\n",
       "      <td>0</td>\n",
       "      <td>32</td>\n",
       "      <td>4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.062500</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.218750</td>\n",
       "      <td>1.750000</td>\n",
       "      <td>0.031250</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.031250</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.125000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>17891</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>21</td>\n",
       "      <td>6.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.012903</td>\n",
       "      <td>0.095238</td>\n",
       "      <td>0.212903</td>\n",
       "      <td>1.571429</td>\n",
       "      <td>0.012903</td>\n",
       "      <td>0.095238</td>\n",
       "      <td>0.032258</td>\n",
       "      <td>0.238095</td>\n",
       "      <td>0.245161</td>\n",
       "      <td>1.809524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>11458</td>\n",
       "      <td>0</td>\n",
       "      <td>184</td>\n",
       "      <td>20</td>\n",
       "      <td>23.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.010870</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.179348</td>\n",
       "      <td>1.650000</td>\n",
       "      <td>0.010870</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.027174</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.206522</td>\n",
       "      <td>1.900000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>17786</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.083333</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.083333</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>15616</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.217391</td>\n",
       "      <td>1.250000</td>\n",
       "      <td>0.043478</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.217391</td>\n",
       "      <td>1.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>10074</td>\n",
       "      <td>0</td>\n",
       "      <td>46</td>\n",
       "      <td>6</td>\n",
       "      <td>1.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.043478</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.195652</td>\n",
       "      <td>1.500000</td>\n",
       "      <td>0.021739</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.108696</td>\n",
       "      <td>0.833333</td>\n",
       "      <td>0.217391</td>\n",
       "      <td>1.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>11726</td>\n",
       "      <td>0</td>\n",
       "      <td>170</td>\n",
       "      <td>21</td>\n",
       "      <td>12.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.017647</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.205882</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.017647</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.023529</td>\n",
       "      <td>0.190476</td>\n",
       "      <td>0.229412</td>\n",
       "      <td>1.857143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>12611</td>\n",
       "      <td>0</td>\n",
       "      <td>129</td>\n",
       "      <td>8</td>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.015504</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.108527</td>\n",
       "      <td>1.750000</td>\n",
       "      <td>0.023256</td>\n",
       "      <td>0.375000</td>\n",
       "      <td>0.038760</td>\n",
       "      <td>0.625000</td>\n",
       "      <td>0.100775</td>\n",
       "      <td>1.625000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>11765</td>\n",
       "      <td>0</td>\n",
       "      <td>51</td>\n",
       "      <td>8</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.274510</td>\n",
       "      <td>1.750000</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.176471</td>\n",
       "      <td>1.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>18894</td>\n",
       "      <td>0</td>\n",
       "      <td>156</td>\n",
       "      <td>12</td>\n",
       "      <td>14.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.025641</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.198718</td>\n",
       "      <td>2.583333</td>\n",
       "      <td>0.012821</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.025641</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.173077</td>\n",
       "      <td>2.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>13123</td>\n",
       "      <td>0</td>\n",
       "      <td>389</td>\n",
       "      <td>23</td>\n",
       "      <td>21.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.010283</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>0.110540</td>\n",
       "      <td>1.869565</td>\n",
       "      <td>0.005141</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.012853</td>\n",
       "      <td>0.217391</td>\n",
       "      <td>0.102828</td>\n",
       "      <td>1.739130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>11311</td>\n",
       "      <td>0</td>\n",
       "      <td>109</td>\n",
       "      <td>13</td>\n",
       "      <td>5.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.018349</td>\n",
       "      <td>0.153846</td>\n",
       "      <td>0.201835</td>\n",
       "      <td>1.692308</td>\n",
       "      <td>0.018349</td>\n",
       "      <td>0.153846</td>\n",
       "      <td>0.045872</td>\n",
       "      <td>0.384615</td>\n",
       "      <td>0.211009</td>\n",
       "      <td>1.769231</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>14181</td>\n",
       "      <td>0</td>\n",
       "      <td>51</td>\n",
       "      <td>6</td>\n",
       "      <td>1.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.196078</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.039216</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.058824</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.196078</td>\n",
       "      <td>1.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>14240</td>\n",
       "      <td>1</td>\n",
       "      <td>174</td>\n",
       "      <td>13</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.005747</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.074713</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.005747</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.005747</td>\n",
       "      <td>0.076923</td>\n",
       "      <td>0.074713</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>17353</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.133333</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.266667</td>\n",
       "      <td>1.333333</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>16985</td>\n",
       "      <td>0</td>\n",
       "      <td>30</td>\n",
       "      <td>6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.033333</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.033333</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>22492</td>\n",
       "      <td>0</td>\n",
       "      <td>41</td>\n",
       "      <td>5</td>\n",
       "      <td>6.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.048780</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>0.243902</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.048780</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>0.048780</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>0.146341</td>\n",
       "      <td>1.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>19213</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.304348</td>\n",
       "      <td>1.750000</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.086957</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.173913</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>14957</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.133333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.066667</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>17607</td>\n",
       "      <td>1</td>\n",
       "      <td>70</td>\n",
       "      <td>10</td>\n",
       "      <td>5.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>0.271429</td>\n",
       "      <td>1.900000</td>\n",
       "      <td>0.014286</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.014286</td>\n",
       "      <td>0.100000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>20562</td>\n",
       "      <td>0</td>\n",
       "      <td>31</td>\n",
       "      <td>6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.064516</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.322581</td>\n",
       "      <td>1.666667</td>\n",
       "      <td>0.064516</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>0.032258</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.193548</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29697</th>\n",
       "      <td>65556</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.428571</td>\n",
       "      <td>1.500000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29698</th>\n",
       "      <td>55372</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.375000</td>\n",
       "      <td>1.500000</td>\n",
       "      <td>0.125000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.375000</td>\n",
       "      <td>1.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29699</th>\n",
       "      <td>61941</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29700</th>\n",
       "      <td>53846</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29701</th>\n",
       "      <td>62748</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29702</th>\n",
       "      <td>53489</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29703</th>\n",
       "      <td>51463</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.750000</td>\n",
       "      <td>1.500000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29704</th>\n",
       "      <td>62348</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29705</th>\n",
       "      <td>50199</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29706</th>\n",
       "      <td>50169</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29707</th>\n",
       "      <td>64849</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29708</th>\n",
       "      <td>51673</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29709</th>\n",
       "      <td>54628</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29710</th>\n",
       "      <td>53130</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29711</th>\n",
       "      <td>55099</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29712</th>\n",
       "      <td>57556</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29713</th>\n",
       "      <td>66508</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29714</th>\n",
       "      <td>52280</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29715</th>\n",
       "      <td>51111</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29716</th>\n",
       "      <td>60000</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29717</th>\n",
       "      <td>67492</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29718</th>\n",
       "      <td>50553</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29719</th>\n",
       "      <td>63244</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29720</th>\n",
       "      <td>66825</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.333333</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29721</th>\n",
       "      <td>54067</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29722</th>\n",
       "      <td>60054</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29723</th>\n",
       "      <td>60277</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29724</th>\n",
       "      <td>63384</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29725</th>\n",
       "      <td>56396</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29726</th>\n",
       "      <td>67402</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>29727 rows × 101 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         UID  Tag  op_count  day_count_op  mode_-1  mode_1  mode_2  mode_3  \\\n",
       "0      10035    0       112            23      0.0    23.0     3.0     0.0   \n",
       "1      16264    0       241            21     22.0    21.0     9.0     0.0   \n",
       "2      13162    0        17             3      1.0     2.0     2.0     1.0   \n",
       "3      21392    0        49             9      0.0     9.0     5.0     1.0   \n",
       "4      18599    1       179            13      0.0     0.0    12.0    13.0   \n",
       "5      20499    0       175            16     14.0    16.0     4.0     0.0   \n",
       "6      21634    1        39             6      4.0     5.0     2.0     2.0   \n",
       "7      11305    0        41             6      0.0     6.0     5.0     0.0   \n",
       "8      15270    0        79             7      5.0     5.0     3.0     2.0   \n",
       "9      10655    0        32             4      0.0     4.0     3.0     0.0   \n",
       "10     17891    0       155            21      6.0    20.0    11.0     0.0   \n",
       "11     11458    0       184            20     23.0    20.0     3.0     0.0   \n",
       "12     17786    0        12             3      0.0     3.0     0.0     0.0   \n",
       "13     15616    0        23             4      0.0     4.0     1.0     0.0   \n",
       "14     10074    0        46             6      1.0     6.0     3.0     0.0   \n",
       "15     11726    0       170            21     12.0    20.0    10.0     5.0   \n",
       "16     12611    0       129             8      4.0     8.0     2.0     0.0   \n",
       "17     11765    0        51             8      0.0     8.0     6.0     0.0   \n",
       "18     18894    0       156            12     14.0    12.0     9.0     6.0   \n",
       "19     13123    0       389            23     21.0    20.0     7.0    16.0   \n",
       "20     11311    0       109            13      5.0    13.0     8.0     0.0   \n",
       "21     14181    0        51             6      1.0     6.0     4.0     0.0   \n",
       "22     14240    1       174            13      0.0     0.0    12.0    13.0   \n",
       "23     17353    0        15             3      0.0     3.0     1.0     0.0   \n",
       "24     16985    0        30             6      0.0     6.0     4.0     0.0   \n",
       "25     22492    0        41             5      6.0     5.0     3.0     1.0   \n",
       "26     19213    0        23             4      0.0     4.0     2.0     1.0   \n",
       "27     14957    0        15             1      3.0     1.0     0.0     1.0   \n",
       "28     17607    1        70            10      5.0    10.0     5.0     0.0   \n",
       "29     20562    0        31             6      0.0     5.0     5.0     0.0   \n",
       "...      ...  ...       ...           ...      ...     ...     ...     ...   \n",
       "29697  65556    0         7             2      2.0     1.0     1.0     0.0   \n",
       "29698  55372    0         8             2      0.0     2.0     1.0     0.0   \n",
       "29699  61941    0         5             1      0.0     0.0     1.0     1.0   \n",
       "29700  53846    0         7             1      3.0     0.0     1.0     0.0   \n",
       "29701  62748    0         4             1      0.0     1.0     1.0     0.0   \n",
       "29702  53489    1         5             1      3.0     0.0     1.0     0.0   \n",
       "29703  51463    1         4             2      0.0     1.0     1.0     0.0   \n",
       "29704  62348    1         4             1      0.0     0.0     1.0     1.0   \n",
       "29705  50199    0         5             1      3.0     0.0     1.0     0.0   \n",
       "29706  50169    1         3             1      1.0     1.0     0.0     0.0   \n",
       "29707  64849    1         4             1      0.0     0.0     1.0     1.0   \n",
       "29708  51673    1         6             1      3.0     0.0     1.0     0.0   \n",
       "29709  54628    0         5             1      0.0     1.0     1.0     0.0   \n",
       "29710  53130    1         5             1      0.0     1.0     1.0     0.0   \n",
       "29711  55099    1         4             1      1.0     1.0     0.0     0.0   \n",
       "29712  57556    1         2             1      0.0     0.0     0.0     0.0   \n",
       "29713  66508    0         6             1      0.0     1.0     1.0     0.0   \n",
       "29714  52280    1         4             1      0.0     1.0     1.0     0.0   \n",
       "29715  51111    0         3             1      0.0     1.0     1.0     0.0   \n",
       "29716  60000    0         6             1      3.0     0.0     1.0     0.0   \n",
       "29717  67492    0         4             1      0.0     1.0     1.0     0.0   \n",
       "29718  50553    0         5             1      0.0     1.0     1.0     1.0   \n",
       "29719  63244    1         4             1      0.0     0.0     1.0     1.0   \n",
       "29720  66825    1         3             1      0.0     0.0     0.0     1.0   \n",
       "29721  54067    1         1             1      0.0     0.0     0.0     0.0   \n",
       "29722  60054    0         2             1      0.0     1.0     1.0     0.0   \n",
       "29723  60277    1         1             1      0.0     0.0     0.0     0.0   \n",
       "29724  63384    1         1             1      0.0     0.0     0.0     0.0   \n",
       "29725  56396    1         1             1      0.0     0.0     0.0     0.0   \n",
       "29726  67402    1         1             1      0.0     0.0     0.0     0.0   \n",
       "\n",
       "       mode_4  mode_5         ...           avg_op_device_count  \\\n",
       "0         0.0     0.0         ...                      0.017857   \n",
       "1         0.0     1.0         ...                      0.008299   \n",
       "2         0.0     1.0         ...                      0.176471   \n",
       "3         0.0     0.0         ...                      0.040816   \n",
       "4         0.0    13.0         ...                      0.005587   \n",
       "5         0.0     0.0         ...                      0.011429   \n",
       "6         3.0     0.0         ...                      0.102564   \n",
       "7         0.0     2.0         ...                      0.048780   \n",
       "8         3.0     0.0         ...                      0.037975   \n",
       "9         0.0     0.0         ...                      0.062500   \n",
       "10        0.0     0.0         ...                      0.012903   \n",
       "11        0.0     0.0         ...                      0.010870   \n",
       "12        0.0     0.0         ...                      0.083333   \n",
       "13        0.0     0.0         ...                      0.086957   \n",
       "14        0.0     0.0         ...                      0.043478   \n",
       "15        4.0     1.0         ...                      0.017647   \n",
       "16        0.0     2.0         ...                      0.015504   \n",
       "17        0.0     3.0         ...                      0.039216   \n",
       "18        5.0     0.0         ...                      0.025641   \n",
       "19       15.0     6.0         ...                      0.010283   \n",
       "20        0.0     3.0         ...                      0.018349   \n",
       "21        0.0     1.0         ...                      0.039216   \n",
       "22        0.0    13.0         ...                      0.005747   \n",
       "23        0.0     0.0         ...                      0.133333   \n",
       "24        0.0     0.0         ...                      0.066667   \n",
       "25        1.0     0.0         ...                      0.048780   \n",
       "26        1.0     3.0         ...                      0.086957   \n",
       "27        1.0     0.0         ...                      0.066667   \n",
       "28        0.0     4.0         ...                      0.028571   \n",
       "29        0.0     0.0         ...                      0.064516   \n",
       "...       ...     ...         ...                           ...   \n",
       "29697     0.0     0.0         ...                      0.285714   \n",
       "29698     0.0     0.0         ...                      0.250000   \n",
       "29699     1.0     0.0         ...                      0.400000   \n",
       "29700     0.0     0.0         ...                      0.285714   \n",
       "29701     0.0     0.0         ...                      0.500000   \n",
       "29702     0.0     0.0         ...                      0.400000   \n",
       "29703     0.0     1.0         ...                      0.500000   \n",
       "29704     1.0     0.0         ...                      0.500000   \n",
       "29705     0.0     0.0         ...                      0.400000   \n",
       "29706     0.0     1.0         ...                      0.666667   \n",
       "29707     1.0     0.0         ...                      0.500000   \n",
       "29708     0.0     0.0         ...                      0.333333   \n",
       "29709     0.0     0.0         ...                      0.400000   \n",
       "29710     0.0     1.0         ...                      0.400000   \n",
       "29711     0.0     1.0         ...                      0.500000   \n",
       "29712     1.0     0.0         ...                      0.500000   \n",
       "29713     0.0     0.0         ...                      0.333333   \n",
       "29714     0.0     1.0         ...                      0.500000   \n",
       "29715     0.0     0.0         ...                      0.666667   \n",
       "29716     0.0     0.0         ...                      0.333333   \n",
       "29717     0.0     0.0         ...                      0.500000   \n",
       "29718     1.0     0.0         ...                      0.400000   \n",
       "29719     1.0     0.0         ...                      0.500000   \n",
       "29720     1.0     0.0         ...                      0.333333   \n",
       "29721     1.0     0.0         ...                      1.000000   \n",
       "29722     0.0     0.0         ...                      1.000000   \n",
       "29723     0.0     1.0         ...                      1.000000   \n",
       "29724     0.0     1.0         ...                      1.000000   \n",
       "29725     0.0     1.0         ...                      1.000000   \n",
       "29726     0.0     1.0         ...                      1.000000   \n",
       "\n",
       "       avg_op_day_device_count  avg_op_device_day  avg_op_day_device_day  \\\n",
       "0                     0.086957           0.232143               1.130435   \n",
       "1                     0.095238           0.153527               1.761905   \n",
       "2                     1.000000           0.294118               1.666667   \n",
       "3                     0.222222           0.285714               1.555556   \n",
       "4                     0.076923           0.072626               1.000000   \n",
       "5                     0.125000           0.137143               1.500000   \n",
       "6                     0.666667           0.205128               1.333333   \n",
       "7                     0.333333           0.268293               1.833333   \n",
       "8                     0.428571           0.164557               1.857143   \n",
       "9                     0.500000           0.218750               1.750000   \n",
       "10                    0.095238           0.212903               1.571429   \n",
       "11                    0.100000           0.179348               1.650000   \n",
       "12                    0.333333           0.250000               1.000000   \n",
       "13                    0.500000           0.217391               1.250000   \n",
       "14                    0.333333           0.195652               1.500000   \n",
       "15                    0.142857           0.205882               1.666667   \n",
       "16                    0.250000           0.108527               1.750000   \n",
       "17                    0.250000           0.274510               1.750000   \n",
       "18                    0.333333           0.198718               2.583333   \n",
       "19                    0.173913           0.110540               1.869565   \n",
       "20                    0.153846           0.201835               1.692308   \n",
       "21                    0.333333           0.196078               1.666667   \n",
       "22                    0.076923           0.074713               1.000000   \n",
       "23                    0.666667           0.266667               1.333333   \n",
       "24                    0.333333           0.333333               1.666667   \n",
       "25                    0.400000           0.243902               2.000000   \n",
       "26                    0.500000           0.304348               1.750000   \n",
       "27                    1.000000           0.066667               1.000000   \n",
       "28                    0.200000           0.271429               1.900000   \n",
       "29                    0.333333           0.322581               1.666667   \n",
       "...                        ...                ...                    ...   \n",
       "29697                 1.000000           0.428571               1.500000   \n",
       "29698                 1.000000           0.375000               1.500000   \n",
       "29699                 2.000000           0.400000               2.000000   \n",
       "29700                 2.000000           0.285714               2.000000   \n",
       "29701                 2.000000           0.500000               2.000000   \n",
       "29702                 2.000000           0.400000               2.000000   \n",
       "29703                 1.000000           0.750000               1.500000   \n",
       "29704                 2.000000           0.500000               2.000000   \n",
       "29705                 2.000000           0.400000               2.000000   \n",
       "29706                 2.000000           0.666667               2.000000   \n",
       "29707                 2.000000           0.500000               2.000000   \n",
       "29708                 2.000000           0.333333               2.000000   \n",
       "29709                 2.000000           0.400000               2.000000   \n",
       "29710                 2.000000           0.400000               2.000000   \n",
       "29711                 2.000000           0.500000               2.000000   \n",
       "29712                 1.000000           0.500000               1.000000   \n",
       "29713                 2.000000           0.333333               2.000000   \n",
       "29714                 2.000000           0.500000               2.000000   \n",
       "29715                 2.000000           0.666667               2.000000   \n",
       "29716                 2.000000           0.333333               2.000000   \n",
       "29717                 2.000000           0.500000               2.000000   \n",
       "29718                 2.000000           0.400000               2.000000   \n",
       "29719                 2.000000           0.500000               2.000000   \n",
       "29720                 1.000000           0.333333               1.000000   \n",
       "29721                 1.000000           1.000000               1.000000   \n",
       "29722                 2.000000           1.000000               2.000000   \n",
       "29723                 1.000000           1.000000               1.000000   \n",
       "29724                 1.000000           1.000000               1.000000   \n",
       "29725                 1.000000           1.000000               1.000000   \n",
       "29726                 1.000000           1.000000               1.000000   \n",
       "\n",
       "       avg_op_mac1  avg_op_day_mac1  avg_op_wifi  avg_op_day_wifi  \\\n",
       "0         0.017857         0.086957     0.035714         0.173913   \n",
       "1         0.012448         0.142857     0.012448         0.142857   \n",
       "2         0.117647         0.666667     0.176471         1.000000   \n",
       "3         0.040816         0.222222     0.040816         0.222222   \n",
       "4         0.005587         0.076923     0.005587         0.076923   \n",
       "5         0.011429         0.125000     0.022857         0.250000   \n",
       "6         0.205128         1.333333     0.102564         0.666667   \n",
       "7         0.024390         0.166667     0.073171         0.500000   \n",
       "8         0.025316         0.285714     0.037975         0.428571   \n",
       "9         0.031250         0.250000     0.031250         0.250000   \n",
       "10        0.012903         0.095238     0.032258         0.238095   \n",
       "11        0.010870         0.100000     0.027174         0.250000   \n",
       "12        0.083333         0.333333     0.166667         0.666667   \n",
       "13        0.043478         0.250000     0.086957         0.500000   \n",
       "14        0.021739         0.166667     0.108696         0.833333   \n",
       "15        0.017647         0.142857     0.023529         0.190476   \n",
       "16        0.023256         0.375000     0.038760         0.625000   \n",
       "17        0.039216         0.250000     0.039216         0.250000   \n",
       "18        0.012821         0.166667     0.025641         0.333333   \n",
       "19        0.005141         0.086957     0.012853         0.217391   \n",
       "20        0.018349         0.153846     0.045872         0.384615   \n",
       "21        0.039216         0.333333     0.058824         0.500000   \n",
       "22        0.005747         0.076923     0.005747         0.076923   \n",
       "23        0.066667         0.333333     0.066667         0.333333   \n",
       "24        0.033333         0.166667     0.033333         0.166667   \n",
       "25        0.048780         0.400000     0.048780         0.400000   \n",
       "26        0.086957         0.500000     0.086957         0.500000   \n",
       "27        0.133333         2.000000     0.066667         1.000000   \n",
       "28        0.014286         0.100000     0.014286         0.100000   \n",
       "29        0.064516         0.333333     0.032258         0.166667   \n",
       "...            ...              ...          ...              ...   \n",
       "29697     0.285714         1.000000     0.285714         1.000000   \n",
       "29698     0.125000         0.500000     0.250000         1.000000   \n",
       "29699     0.400000         2.000000     0.400000         2.000000   \n",
       "29700     0.285714         2.000000     0.142857         1.000000   \n",
       "29701     0.250000         1.000000     0.500000         2.000000   \n",
       "29702     0.200000         1.000000     0.200000         1.000000   \n",
       "29703     0.250000         0.500000     0.250000         0.500000   \n",
       "29704     0.500000         2.000000     0.500000         2.000000   \n",
       "29705     0.400000         2.000000     0.400000         2.000000   \n",
       "29706     0.333333         1.000000     0.333333         1.000000   \n",
       "29707     0.250000         1.000000     0.250000         1.000000   \n",
       "29708     0.333333         2.000000     0.166667         1.000000   \n",
       "29709     0.200000         1.000000     0.200000         1.000000   \n",
       "29710     0.200000         1.000000     0.200000         1.000000   \n",
       "29711     0.250000         1.000000     0.250000         1.000000   \n",
       "29712     0.500000         1.000000     0.500000         1.000000   \n",
       "29713     0.166667         1.000000     0.333333         2.000000   \n",
       "29714     0.250000         1.000000     0.250000         1.000000   \n",
       "29715     0.333333         1.000000     0.666667         2.000000   \n",
       "29716     0.333333         2.000000     0.166667         1.000000   \n",
       "29717     0.250000         1.000000     0.500000         2.000000   \n",
       "29718     0.200000         1.000000     0.400000         2.000000   \n",
       "29719     0.250000         1.000000     0.500000         2.000000   \n",
       "29720     0.333333         1.000000     0.666667         2.000000   \n",
       "29721     1.000000         1.000000     1.000000         1.000000   \n",
       "29722     0.500000         1.000000     0.500000         1.000000   \n",
       "29723     1.000000         1.000000     1.000000         1.000000   \n",
       "29724     1.000000         1.000000     1.000000         1.000000   \n",
       "29725     1.000000         1.000000     1.000000         1.000000   \n",
       "29726     1.000000         1.000000     1.000000         1.000000   \n",
       "\n",
       "       avg_op_wifi_day  avg_op_day_wifi_day  \n",
       "0             0.250000             1.217391  \n",
       "1             0.161826             1.857143  \n",
       "2             0.235294             1.333333  \n",
       "3             0.224490             1.222222  \n",
       "4             0.072626             1.000000  \n",
       "5             0.142857             1.562500  \n",
       "6             0.256410             1.666667  \n",
       "7             0.268293             1.833333  \n",
       "8             0.139241             1.571429  \n",
       "9             0.125000             1.000000  \n",
       "10            0.245161             1.809524  \n",
       "11            0.206522             1.900000  \n",
       "12            0.250000             1.000000  \n",
       "13            0.217391             1.250000  \n",
       "14            0.217391             1.666667  \n",
       "15            0.229412             1.857143  \n",
       "16            0.100775             1.625000  \n",
       "17            0.176471             1.125000  \n",
       "18            0.173077             2.250000  \n",
       "19            0.102828             1.739130  \n",
       "20            0.211009             1.769231  \n",
       "21            0.196078             1.666667  \n",
       "22            0.074713             1.000000  \n",
       "23            0.200000             1.000000  \n",
       "24            0.200000             1.000000  \n",
       "25            0.146341             1.200000  \n",
       "26            0.173913             1.000000  \n",
       "27            0.066667             1.000000  \n",
       "28            0.142857             1.000000  \n",
       "29            0.193548             1.000000  \n",
       "...                ...                  ...  \n",
       "29697         0.285714             1.000000  \n",
       "29698         0.375000             1.500000  \n",
       "29699         0.400000             2.000000  \n",
       "29700         0.142857             1.000000  \n",
       "29701         0.500000             2.000000  \n",
       "29702         0.200000             1.000000  \n",
       "29703         0.500000             1.000000  \n",
       "29704         0.500000             2.000000  \n",
       "29705         0.400000             2.000000  \n",
       "29706         0.333333             1.000000  \n",
       "29707         0.250000             1.000000  \n",
       "29708         0.166667             1.000000  \n",
       "29709         0.200000             1.000000  \n",
       "29710         0.200000             1.000000  \n",
       "29711         0.250000             1.000000  \n",
       "29712         0.500000             1.000000  \n",
       "29713         0.333333             2.000000  \n",
       "29714         0.250000             1.000000  \n",
       "29715         0.666667             2.000000  \n",
       "29716         0.166667             1.000000  \n",
       "29717         0.500000             2.000000  \n",
       "29718         0.400000             2.000000  \n",
       "29719         0.500000             2.000000  \n",
       "29720         0.666667             2.000000  \n",
       "29721         1.000000             1.000000  \n",
       "29722         0.500000             1.000000  \n",
       "29723         1.000000             1.000000  \n",
       "29724         1.000000             1.000000  \n",
       "29725         1.000000             1.000000  \n",
       "29726         1.000000             1.000000  \n",
       "\n",
       "[29727 rows x 101 columns]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_op_feature[train_op_feature.Tag != -1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{14529}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(train_op_tr.UID.unique()) - set(train_op_feature[train_op_feature.Tag != -1].UID)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "train_op_feature.to_csv('./operation_feature.csv', index=False, encoding='utf-8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
